﻿<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        * {
            margin: 0;
            padding: 0
        }

        img {
            vertical-align: top;
        }

        .top {
            width: 1500px;
            margin: 0 auto;
        }

        .main {
            margin: 0 auto;
            width: 1000px;
        }

        #Q-nav {
            width: 1500px;
            margin: 0 auto;
            overflow: hidden;
        }
    </style>
    <script src="../jquery-1.11.1.js"></script>
    <script>
        jQuery(document).ready(function($) {
            let top = $('#Q-nav').offset().top;
            $(window).scroll(function() {
                if ($('html, body').scrollTop() > top) {
                    $('#Q-nav').css({position: 'fixed', top: 0});
                } else {
                    $('#Q-nav').css({position: 'absolute', top });
                }
            });
        });
    </script>
</head>
<body>

    <!--第一张图片-->
    <div class="top" id="top">
        <img src="images/top.png" alt=""/>
    </div>
    <!--第二张图片-->
    <div id="Q-nav">
        <img src="images/nav.png" alt=""/>
    </div>
    <!--第三张图片-->
    <div class="main" id="main">
        <img src="images/main.png" alt=""/>
    </div>


</body>
</html>

